<?xml version="1.0" encoding="utf-8"?>
<witd:WITD application="Work item type editor" version="1.0" xmlns:witd="http://schemas.microsoft.com/VisualStudio/2008/workitemtracking/typedef">
  <WORKITEMTYPE name="Sprint Backlog Task">
    <DESCRIPTION>Includes information about a particular Sprint Backlog Task</DESCRIPTION>
    <FIELDS>
      <FIELD name="Iteration Path" refname="System.IterationPath" type="TreePath" reportable="dimension">
        <HELPTEXT>Choose the Sprint in which this task will be worked on</HELPTEXT>
      </FIELD>
      <FIELD name="Iteration ID" refname="System.IterationId" type="Integer" />
      <FIELD name="External Link Count" refname="System.ExternalLinkCount" type="Integer" reportable="measure" formula="sum" />
      <FIELD name="Team Project" refname="System.TeamProject" type="String" reportable="dimension" />
      <FIELD name="Hyperlink Count" refname="System.HyperLinkCount" type="Integer" reportable="measure" formula="sum" />
      <FIELD name="Attached File Count" refname="System.AttachedFileCount" type="Integer" reportable="measure" formula="sum" />
      <FIELD name="Node Name" refname="System.NodeName" type="String" />
      <FIELD name="Area Path" refname="System.AreaPath" type="TreePath" reportable="dimension">
        <HELPTEXT>Feature Scope can be used to categorise or theme a Sprint Task and can be different to the Product Backlog Feature Path</HELPTEXT>
      </FIELD>
      <FIELD name="Revised Date" refname="System.RevisedDate" type="DateTime" reportable="detail" />
      <FIELD name="Changed Date" refname="System.ChangedDate" type="DateTime" reportable="dimension" />
      <FIELD name="ID" refname="System.Id" type="Integer" reportable="dimension">
        <HELPTEXT>Human readable, auto-populated numeric Id</HELPTEXT>
      </FIELD>
      <FIELD name="Area ID" refname="System.AreaId" type="Integer" />
      <FIELD name="Authorized As" refname="System.AuthorizedAs" type="String" syncnamechanges="true" />
      <FIELD name="Title" refname="System.Title" type="String" reportable="dimension">
        <HELPTEXT>Name or short description that clearly identifies the task</HELPTEXT>
        <REQUIRED />
        <CANNOTLOSEVALUE />
      </FIELD>
      <FIELD name="State" refname="System.State" type="String" reportable="dimension">
        <HELPTEXT>This is the status of the current status of the task as selected by a team member</HELPTEXT>
      </FIELD>
      <FIELD name="Authorized Date" refname="System.AuthorizedDate" type="DateTime" />
      <FIELD name="Watermark" refname="System.Watermark" type="Integer" />
      <FIELD name="Rev" refname="System.Rev" type="Integer" reportable="dimension" />
      <FIELD name="Changed By" refname="System.ChangedBy" type="String" syncnamechanges="true" reportable="dimension" />
      <FIELD name="Reason" refname="System.Reason" type="String" reportable="dimension" />
      <FIELD name="Assigned To" refname="System.AssignedTo" type="String" syncnamechanges="true" reportable="dimension">
        <HELPTEXT>The team member currently assigned to act on the task</HELPTEXT>
        <ALLOWEDVALUES expanditems="true" filteritems="excludegroups">
          <LISTITEM value="[project]\Project Administrators" />
          <LISTITEM value="[project]\Contributors" />
        </ALLOWEDVALUES>
      </FIELD>
      <FIELD name="Work Item Type" refname="System.WorkItemType" type="String" reportable="dimension" />
      <FIELD name="Created Date" refname="System.CreatedDate" type="DateTime" reportable="dimension" />
      <FIELD name="Created By" refname="System.CreatedBy" type="String" syncnamechanges="true" reportable="dimension" />
      <FIELD name="Description" refname="System.Description" type="HTML">
        <HELPTEXT>Detailed description of the task</HELPTEXT>
      </FIELD>
      <FIELD name="History" refname="System.History" type="History">
        <HELPTEXT>Discussion thread and other historical information including fields that have changed, by whom and when.</HELPTEXT>
      </FIELD>
      <FIELD name="Related Link Count" refname="System.RelatedLinkCount" type="Integer" />
      <FIELD name="Tags" refname="System.Tags" type="PlainText" />
      <FIELD name="History Date (Scrum v3)" refname="Scrum.v3.HistoryDate" type="DateTime" reportable="dimension">
        <COPY from="clock" />
        <DEFAULT from="clock" />
      </FIELD>
      <FIELD name="Work Remaining (Scrum v3)" refname="Scrum.v3.WorkRemaining" type="Double" reportable="measure" formula="sum">
        <HELPTEXT>Number of hours remaining on this task or feature updated by team members on at least a daily basis</HELPTEXT>
        <SUGGESTEDVALUES expanditems="true">
          <LISTITEM value="1" />
          <LISTITEM value="2" />
          <LISTITEM value="3" />
          <LISTITEM value="5" />
          <LISTITEM value="8" />
          <LISTITEM value="4" />
          <LISTITEM value="7" />
          <LISTITEM value="6" />
        </SUGGESTEDVALUES>
        <WHENCHANGED field="Scrum.v3.EstimatedEffort">
          <REQUIRED />
        </WHENCHANGED>
      </FIELD>
      <FIELD name="Integration Build" refname="Microsoft.VSTS.Build.IntegrationBuild" type="String" reportable="dimension">
        <HELPTEXT>The build in which the SBT was intergrated</HELPTEXT>
        <SUGGESTEDVALUES expanditems="true">
          <LISTITEM value="&lt;None&gt;" />
        </SUGGESTEDVALUES>
      </FIELD>
      <FIELD name="Estimated Effort (Scrum v3)" refname="Scrum.v3.EstimatedEffort" type="Double" reportable="measure" formula="sum">
        <HELPTEXT>The estimated effort needed to complete the feature in hours</HELPTEXT>
        <SUGGESTEDVALUES expanditems="true">
          <LISTITEM value="1" />
          <LISTITEM value="2" />
          <LISTITEM value="3" />
          <LISTITEM value="5" />
          <LISTITEM value="8" />
          <LISTITEM value="4" />
          <LISTITEM value="7" />
          <LISTITEM value="6" />
        </SUGGESTEDVALUES>
      </FIELD>
      <FIELD name="Task Priority (Scrum v3)" refname="Scrum.v3.TaskPriority" type="Integer" reportable="dimension">
        <HELPTEXT>Order in which this task will be worked on within the Sprint</HELPTEXT>
        <SUGGESTEDVALUES expanditems="true">
          <LISTITEM value="1" />
          <LISTITEM value="2" />
          <LISTITEM value="3" />
          <LISTITEM value="5" />
          <LISTITEM value="8" />
          <LISTITEM value="4" />
          <LISTITEM value="7" />
          <LISTITEM value="6" />
        </SUGGESTEDVALUES>
        <DEFAULT from="value" value="1" />
      </FIELD>
      <!-- START - New Fields as required my Microsoft Scrum -->
      <FIELD name="Backlog Priority" refname="Microsoft.VSTS.Common.BacklogPriority" type="Double" reportable="detail" />
      <FIELD name="Closed Date" refname="Microsoft.VSTS.Common.ClosedDate" type="DateTime" reportable="dimension">
        <WHENNOTCHANGED field="System.State">
          <READONLY />
        </WHENNOTCHANGED>
      </FIELD>
      <FIELD name="Remaining Work" refname="Microsoft.VSTS.Scheduling.RemainingWork" type="Double" reportable="measure" formula="sum" />
      <FIELD name="Activity" refname="Microsoft.VSTS.Common.Activity" type="String" reportable="dimension">
        <SUGGESTEDVALUES>
          <LISTITEM value="Development" />
          <LISTITEM value="Testing" />
          <LISTITEM value="Requirements" />
          <LISTITEM value="Design" />
          <LISTITEM value="Deployment" />
          <LISTITEM value="Documentation" />
        </SUGGESTEDVALUES>
      </FIELD>
      <!-- END - New Fields as required my Microsoft Scrum -->             
    </FIELDS>
    <WORKFLOW>
      <STATES>
		<!-- START - Microsoft Scrum States -->
        <STATE value="To Do">
          <FIELDS>
            <FIELD refname="Microsoft.VSTS.Common.ClosedDate">
              <EMPTY />
            </FIELD>
          </FIELDS>
        </STATE>
        <STATE value="Removed" />
		<!-- END - Microsoft Scrum States -->            
        <STATE value="Not Started" />
        <STATE value="In Progress" />
        <STATE value="Done">
          <FIELDS>
            <FIELD refname="Scrum.v3.WorkRemaining">
              <COPY from="value" value="0" />
              <ALLOWEDVALUES expanditems="true">
                <LISTITEM value="0" />
              </ALLOWEDVALUES>
            </FIELD>
          </FIELDS>
        </STATE>
        <STATE value="Deleted" />
        <STATE value="Descoped" />
      </STATES>
      <TRANSITIONS>
		<!-- START of Custom Transition Rules for SfTS to MS Scrum Migration -->
			<!-- START Support for Forward Migration from SfTS to MS Scrum -->
		        <TRANSITION from="Not Started" to="To Do">
				  <REASONS>
					<DEFAULTREASON value="Forward migrating from SfTS to MS Scrum - ADT .NET Team" />
				  </REASONS>
				</TRANSITION>
		        <TRANSITION from="Deleted" to="Removed">
				  <REASONS>
					<DEFAULTREASON value="Forward migrating from SfTS to MS Scrum - ADT .NET Team" />
				  </REASONS>
				</TRANSITION>				
		        <TRANSITION from="Descoped" to="Removed">
				  <REASONS>
					<DEFAULTREASON value="Forward migrating from SfTS to MS Scrum - ADT .NET Team" />
				  </REASONS>
				</TRANSITION>				
			<!-- END Support for Forward Migration from SfTS to MS Scrum -->
			<!-- START Support for Reverse Migration from MS Scrum to SfTS-->
				<TRANSITION from="To Do" to="Not Started">
				  <REASONS>
					<DEFAULTREASON value="Reverse migrating from MS Scrum to SfTS - ADT .NET Team" />
				  </REASONS>
				</TRANSITION>
				<TRANSITION from="Removed" to="Deleted">
				  <REASONS>
					<DEFAULTREASON value="Reverse migrating from MS Scrum to SfTS - ADT .NET Team" />
				  </REASONS>
				</TRANSITION>
			<!-- END Support for Reverse Migration from MS Scrum to SfTS-->
		<!-- END of Custom Transition Rules for SfTS to MS Scrum Migration -->                  
        <TRANSITION from="" to="Not Started">
          <REASONS>
            <DEFAULTREASON value="New" />
          </REASONS>
        </TRANSITION>
        <TRANSITION from="Deleted" to="Not Started">
          <REASONS>
            <DEFAULTREASON value="Deleted item restored" />
          </REASONS>
        </TRANSITION>
        <TRANSITION from="Descoped" to="Not Started">
          <REASONS>
            <DEFAULTREASON value="Work included in scope." />
          </REASONS>
        </TRANSITION>
        <TRANSITION from="Not Started" to="In Progress">
          <REASONS>
            <DEFAULTREASON value="Work has commenced" />
          </REASONS>
        </TRANSITION>
        <TRANSITION from="Deleted" to="In Progress">
          <REASONS>
            <DEFAULTREASON value="Deleted item restored" />
          </REASONS>
        </TRANSITION>
        <TRANSITION from="Descoped" to="In Progress">
          <REASONS>
            <DEFAULTREASON value="Commenced work included in scope." />
          </REASONS>
        </TRANSITION>
        <TRANSITION from="In Progress" to="Done">
          <REASONS>
            <DEFAULTREASON value="Work has been completed" />
          </REASONS>
        </TRANSITION>
        <TRANSITION from="Deleted" to="Done">
          <REASONS>
            <DEFAULTREASON value="Deleted item restored" />
          </REASONS>
        </TRANSITION>
        <TRANSITION from="Not Started" to="Deleted">
          <REASONS>
            <DEFAULTREASON value="Item marked as deleted" />
          </REASONS>
        </TRANSITION>
        <TRANSITION from="In Progress" to="Deleted">
          <REASONS>
            <DEFAULTREASON value="Item marked as deleted" />
          </REASONS>
        </TRANSITION>
        <TRANSITION from="Done" to="Deleted">
          <REASONS>
            <DEFAULTREASON value="Item marked as deleted" />
          </REASONS>
        </TRANSITION>
        <TRANSITION from="Descoped" to="Deleted">
          <REASONS>
            <DEFAULTREASON value="Item marked as deleted" />
          </REASONS>
        </TRANSITION>
        <TRANSITION from="Not Started" to="Descoped">
          <REASONS>
            <DEFAULTREASON value="Item removed from scope" />
          </REASONS>
        </TRANSITION>
        <TRANSITION from="In Progress" to="Descoped">
          <REASONS>
            <DEFAULTREASON value="Item removed from scope" />
          </REASONS>
        </TRANSITION>
        <TRANSITION from="Deleted" to="Descoped">
          <REASONS>
            <DEFAULTREASON value="Deleted item restored" />
          </REASONS>
        </TRANSITION>
      </TRANSITIONS>
    </WORKFLOW>
    <FORM>
      <Layout>
        <Group>
          <Column PercentWidth="100">
            <Control FieldName="System.Title" Type="FieldControl" Label="Title" LabelPosition="Left" />
          </Column>
        </Group>
        <Group>
          <Column PercentWidth="33">
            <Group Label="Fundamentals">
              <Column PercentWidth="100">
                <Control FieldName="Scrum.v3.EstimatedEffort" Type="FieldControl" Label="Estimated Effort (hours)" LabelPosition="Left" />
                <Control FieldName="System.AreaPath" Type="WorkItemClassificationControl" Label="Feature Scope" LabelPosition="Left" />
              </Column>
            </Group>
          </Column>
          <Column PercentWidth="33">
            <Group Label="Scheduling">
              <Column PercentWidth="100">
                <Control FieldName="System.IterationPath" Type="WorkItemClassificationControl" Label="Planning Scope" LabelPosition="Left" />
                <Control FieldName="Scrum.v3.TaskPriority" Type="FieldControl" Label="Task Priority" LabelPosition="Left" />
              </Column>
            </Group>
          </Column>
          <Column PercentWidth="33">
            <Group Label="Tracking">
              <Column PercentWidth="100">
                <Control FieldName="Scrum.v3.WorkRemaining" Type="FieldControl" Label="Work Remaining (hours)" LabelPosition="Left" />
                <Control FieldName="System.AssignedTo" Type="FieldControl" Label="Owned By" LabelPosition="Left" />
                <Control FieldName="System.State" Type="FieldControl" Label="Current Status" LabelPosition="Left" />
              </Column>
            </Group>
          </Column>
        </Group>
        <TabGroup>
          <Tab Label="Description and History">
            <Group>
              <Column PercentWidth="100">
                <Control FieldName="System.Description" Type="HtmlFieldControl" Label="Description:" LabelPosition="Top" Dock="Top" MinimumSize="(100,100)" />
                <Control FieldName="System.History" Type="WorkItemLogControl" Label="History:" LabelPosition="Top" Dock="Fill" />
              </Column>
            </Group>
          </Tab>
          <Tab Label="Implements">
            <Control Type="LinksControl" Name="BacklogItemLink" Label="The implemented Backlog Item:" LabelPosition="Top">
              <LinksControlOptions>
                <WorkItemLinkFilters FilterType="include">
                  <Filter LinkType="Scrum.ImplementedBy" FilterOn="reversename" />
                </WorkItemLinkFilters>
                <WorkItemTypeFilters FilterType="include">
                  <Filter WorkItemType="Product Backlog Item" />
                </WorkItemTypeFilters>
                <ExternalLinkFilters FilterType="excludeAll" />
                <LinkColumns>
                  <LinkColumn RefName="System.ID" />
                  <LinkColumn RefName="System.Links.LinkType" />
                  <LinkColumn RefName="System.WorkItemType" />
                  <LinkColumn RefName="System.Title" />
                  <LinkColumn RefName="System.State" />
                  <LinkColumn LinkAttribute="System.Links.Comment" />
                </LinkColumns>
              </LinksControlOptions>
            </Control>
          </Tab>
          <Tab Label="All Links">
            <Control Type="LinksControl" Name="OtherLinks">
              <LinksControlOptions>
                <LinkColumns>
                  <LinkColumn RefName="System.ID" />
                  <LinkColumn RefName="System.Links.LinkType" />
                  <LinkColumn RefName="System.WorkItemType" />
                  <LinkColumn RefName="System.Title" />
                  <LinkColumn RefName="System.AssignedTo" />
                  <LinkColumn RefName="System.State" />
                  <LinkColumn LinkAttribute="System.Links.Comment" />
                </LinkColumns>
              </LinksControlOptions>
            </Control>
          </Tab>
          <Tab Label="File Attachments">
            <Control Type="AttachmentsControl" LabelPosition="Top" />
          </Tab>
          <Tab Label="Process Guidance">
            <Control Type="WebpageControl" LabelPosition="Top" Dock="Fill">
              <WebpageControlOptions AllowScript="false">
                <Link UrlRoot="http://www.scrumforteamsystem.co.uk/" UrlPath="/processguidance/v3/{0}/{1}">
                  <Param Index="0" Value="System.WorkItemType" Type="Current" />
                  <Param Index="1" Value="System.State" Type="Current" />
                </Link>
              </WebpageControlOptions>
            </Control>
          </Tab>
        </TabGroup>
      </Layout>
    </FORM>
  </WORKITEMTYPE>
</witd:WITD>